use "$rawdatapath/jobb_2019.dta",clear
egen lonfink = rowtotal(lonfink*)

gen work1 = 1 if lonfinkjan>0
gen work2 = 2 if lonfinkfeb>0
gen work3 = 3 if lonfinkmars>0
gen work4 = 4 if lonfinkapr>0
gen work5 = 5 if lonfinkmaj>0
gen work6 = 6 if lonfinkjuni>0
gen work7 = 7 if lonfinkjuli>0
gen work8 = 8 if lonfinkaug>0
gen work9 = 9 if lonfinksep>0
gen work10 = 10 if lonfinkokt>0
gen work11 = 11 if lonfinknov>0
gen work12 = 12 if lonfinkdec>0

gen manfran = .
gen mantill = .
forvalues i =1(1)12{
	replace manfran = work`i' if manfran==. & work`i'!=.
	replace mantill = work`i' if work`i'!=.
}	
replace manfran=0 if manfran==.
replace mantill=0 if mantill==.
drop lonfinkjan-lonfinkdec work1-work12

rename yrkstallnagi yrkstallnku
tostring yrkstallnku,replace
compress
save "$datapath/A0_jobb2019.dta",replace
